<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万座网旅游分销平台-订单列表</title>
<link href="../style/frame.css" rel="stylesheet" type="text/css" />
<link href="../style/common2.css" type="text/css" rel="stylesheet" />
<link href="../style/mainStyle.css" type="text/css" rel="stylesheet" />
<script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="../js/common.js" type="text/javascript"></script>
<script src="../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

<link type="text/css" href="../lhgdialog/lhgdialog.css" rel="stylesheet"/>
<script type="text/javascript" src="../lhgdialog/lhgcore.min.js"></script>
<script type="text/javascript" src="../lhgdialog/lhgdialog.js"></script>

</head>

<body>
<div class="mainbody">	
	<!--子目录导航-->
    <div class="subnav">您当前位置：订单列表</div>	
    
    <!--景点搜索-->
    <div class="prod_search">
    	<div class="prod_s_title">订单筛选 <span class="fold" onclick="expand(this)"> </span></div>
        <div class="prod_s_cont" id="pro_search">
        <form name="ordlistF" method="post" action="order.php?act=list">
        <input type="hidden" name="s" value="<?php echo $s;?>" />
   	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="29" style="color:#666;">订单状态：</td>
                <td width="94%"  style="color:#666;"><a href="order.php?act=list&s=1" target="main" class="<?php if($s==1){ echo 'num_color';} ?>">未支付</a>(<span class="num_color"><?php echo $ord->getOrderNum(1);?></span>)&nbsp; | &nbsp;<a href="order.php?act=list&s=2" target="main" class="<?php if($s==2){ echo 'num_color';} ?>">待确认订单</a>(<span class="num_color"><?php echo $ord->getOrderNum(2);?></span>)&nbsp; | &nbsp;<a href="order.php?act=list&s=3" target="main" class="<?php if($s==3){ echo 'num_color';} ?>">待出票订单</a>(<span class="num_color"><?php echo $ord->getOrderNum(3);?></span>)&nbsp; | &nbsp;<a href="order.php?act=list&s=4" target="main"  class="<?php if($s==4){ echo 'num_color';} ?>">待游玩订单</a>(<span class="num_color"><?php echo $ord->getOrderNum(4);?></span>)&nbsp; | &nbsp;<a href="order.php?act=list&s=5" target="main" class="<?php if($s==5){ echo 'num_color';} ?>">已完成订单</a>(<span class="num_color"><?php echo $ord->getOrderNum(5);?></span>)&nbsp; | &nbsp;<a href="order.php?act=list&s=6" target="main" class="<?php if($s==6){ echo 'num_color';} ?>">失败订单</a>(<span class="num_color"><?php echo $ord->getOrderNum(6);?></span>)&nbsp; | &nbsp;<a href="order.php?act=list&s=7" target="main" class="<?php if($s==7){ echo 'num_color';} ?>">取消订单</a>(<span class="num_color"><?php echo $ord->getOrderNum(7);?></span>)</td>
              </tr>
              <tr>
                <td style="color:#666;">下单日期：</td>
                <td style="padding:8px 0px;color:#666;"><input type="text" name="begDate" class="search_bg_time"  onClick="WdatePicker({skin:'whyGreen'})" value="<?php echo $begDate;?>"/>至 &nbsp;&nbsp;<input type="text" name="endDate" class="search_bg_time" onClick="WdatePicker({skin:'whyGreen'})" value="<?php echo $endDate;?>"/> <span class="p_s_span"> 关键词：</span><input type="text" name="name" class="search_bg_input" value="<?php echo $name;?>" style="height:24px;  line-height:24px;"/> <span style="color:#999;">(输入联系人姓名，手机，订单号等关键词)</span> <input type="submit" value="搜索" class="search_bg_btn" /></td>
              </tr>
            </table>

        </form>
        </div>
    </div>
    
    <!--景点列表-->
    <div class="prod_list list">
    <table width="100%" border="0" cellpadding="3" cellspacing="1"  style="margin:0px; border:0px;">
          <col width="80" />
          <col />
          <col width="260" />
          <col width="100" />
          <thead>
              <tr>
                  <td>订单金额</td>
                  <td style="text-align:left;">订单内容</td>
                  <td>状态</td>
                  <td>操作</td>
                  
              </tr>
          </thead>
          <tbody> 
          <?php
          	if($orderList){
            	foreach($orderList as $v){
                	$proDetail=$pro->getTicketDetail($v['Tord_tkt_id']);//门票相关的
                    $s=$s?$s:$v['Tord_status'];
                    //dump($proDetail);
          ?> 
              <tr>
                  <td><span class="num_color" style="font-size:18px;">&yen;<?php echo $v['Tord_num']*$proDetail['Tkt_price3']+$proDetail['Tkt_freight']; ?></span></td>
                  <td style="text-align:left;">
                  	<div style=" padding:8px 5px;">
                        <p class="t1" style="font-size:14px;">订单编号：<a href="order.php?act=detail&ordid=<?php echo $v['Tord_id'];?>&s=<?php echo $s;?>&aid=<?php echo $v['Tord_att_id'];?>&id=<?php echo $v['Tord_tkt_id'];?>" style=" font-size:16px; font-weight:bold;"><?php echo $v['Tord_id'];?></a></p>
                        <p class="t1"><a href="products.php?act=detail&aid=<?php echo $v['Tord_att_id'];?>&id=<?php echo $v['Tord_tkt_id'];?>"><?php echo $v['Tord_ticketName'];?></a></p>
                        <p class="t2">下单时间： <span class="num_color2"><?php echo date('Y-m-d H:i:s',$v['Tord_createtime']);?> </span> &nbsp;&nbsp;游玩时间： <span class="num_color2"><?php echo date('Y-m-d',$v['Tord_playdate']);?> </span> </p>
                        <p class="t3">联系人：<?php echo $v['per_name'];?> (<?php echo $v['per_phone'];?>)</p>
                    </div>
                  </td>
                  <td>
                  	<?php echo $ord->getStatus($v['Tord_status']); ?>
                    
                  </td>
                  <td>
                  	<?php if($v['Tord_status']==1){?><a href="javascript:void(0)" id="pay_<?php echo $v['Tord_id'];?>" onclick="pay('pay_<?php echo $v['Tord_id'];?>',<?php echo $v['Tord_id'];?>);return false;">支付</a><?php }?> 
                    <?php if($v['Tord_status']==1 or $v['Tord_status']==2){?>
                    <a href="order.php?act=modify&id=<?php echo $v['Tord_id'];?>&s=<?php echo $s;?>" target="_blank">修改</a> 
                    <a href="javascript:void(0)" onclick="cancel(<?php echo $v['Tord_id'];?>);return false;">撤单</a>
                    <?php }?>
                    
                    <?php if($v['Tord_status']==3 or $v['Tord_status']==4 or $v['Tord_status']==5 or $v['Tord_status']==6 or $v['Tord_status']==7){ echo '无';} ?>
                  </td>
              </tr>
             <?php }}else{?>
             <tr><td colspan="4">暂无信息</td></tr>
             <?php }?>
        </tbody>
      </table>
      
      <div class="page"><?php if($orderList){ echo $page->show(4);}?></div>      
    </div>
</div>
<script>
    	//支付
		function pay(iid,id){
			if(confirm("确定要支付？")){
				J('#'+iid).dialog({ id: 'zhifu', title: '付款',rang:true, width:420,height:260, page: 'order.php?act=showDialog&id='+id,btns:true,cover:true,lockScroll:true}); 
			}
		}
		//撤单
		function cancel(id){
			if(confirm("确定要撤销订单？")){
				location.href="order.php?act=cancel&id="+id;	
			}	
		}
    </script>
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));
</script>
</body>
</html>
